﻿@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication

<AuthorizeView>
	<Authorized>
		<button class="nav-link btn btn-link" @onclick="BeginSignOut">
			Log out
		</button>
	</Authorized>
	<NotAuthorized>
		<a href="authentication/login">Log in</a>
	</NotAuthorized>
</AuthorizeView>

@code {
#pragma warning disable CS0618
	[Inject] SignOutSessionStateManager SignOutManager { get;set;} = default!;
#pragma warning restore CS0618

	private async Task BeginSignOut(MouseEventArgs args)
	{
		await SignOutManager.SetSignOutState();
	}
}
